package com.usf.jprovider.schema.selector.entry;

import com.usf.jprovider.object.JObjectNode;
import com.usf.jprovider.object.env.Environment;


public final class LastEntry extends AbstractEntrySelector{

	public LastEntry() {
		super();
	}

	@Override
	public int index(Environment env, JObjectNode node, int size) {
		return size - 1;
	}
	@Override
	protected int startIndex(Environment env, JObjectNode node, int size) {
		return index(env, node, size);
	}
	@Override
	protected int endIndex(Environment env, JObjectNode node, int size) {
		return index(env, node, size);
	}

	@Override
	public String selectField(Environment env, String table, String column) {
		return env.getConnector().selectLast(table, column);
	}
	@Override
	public String selectField(Environment env, String table, String column, String queryValue) {
		return selectField(env, table, column);
	}
	@Override
	public String selectQuery(Environment env, String query) {
		return env.getConnector().selectLast(query);
	}
}
